import type * as T from './type'
import http from '@/utils/http'

export type * from './type'

/**
 * 日志分页
 * @param query
 */
export function pageLog(query: T.LogPageQuery) {
  return http.post<PageRes<T.LogResp[]>>(`/system/log/page`, query)
}

/**
 * 日志详情
 * @param id
 */
export function getLog(id: string) {
  return http.get<T.LogDetailResp>(`/system/log/detail/${id}`)
}

/**
 * 导出登录日志
 * @param query
 */
export function exportLoginLog(query: T.LogQuery) {
  return http.download(`/system/log/export/login`, query)
}

/**
 * 导出操作日志
 * @param query
 */
export function exportOperateLog(query: T.LogQuery) {
  return http.download(`/system/log/export/operate`, query)
}
